import 'package:dio/dio.dart';

class ApiResponse {
	int? errorCode;
	String? errorMsg;
	dynamic? data;

	static ApiResponse createApiResponse(Response response){
		ApiResponse apiResponse = ApiResponse();
		apiResponse.errorCode = response.data?['errorCode'] ?? -1;
		apiResponse.errorMsg = response.data?['errorMsg'] ?? "未知错误";
		apiResponse.data = response.data?['data'];
		return apiResponse;
	}
}
